import service from "@/http";

/**
 * 登陆
 * /api/user/login
 *  @param {Object} data:{}
 * */
export const login = (data) =>
  service({
    method: "post",
    url: "user/login",
    data,
  });

/**
 * 录入用户信息
 * /api/user/recordUser
 *  @param {Object} data:{}
 * */
export const recordUser = (data) =>
  service({
    method: "POST",
    url: "user/recordUser",
    data,
  });

/**
 * 搜索订单
 * /api/user/searchOrderList
 * @param {Object} data:{}
 * */
export const searchOrderList = (data) =>
  service({
    method: "POST",
    url: "user/searchOrderList",
    data,
  });

/**
 * 更新用户信息
 * /api/user/updateUser
 * @param {Object} data:{}
 * */
export const updateUser = (data) =>
  service({
    method: "POST",
    url: "user/updateUser",
    data,
  });

/**
 * 查询用户列表
 * /api/user/getUsers
 *  @param {Object} params:{}
 * */
export const getUsers = (params) =>
  service({
    method: "GET",
    url: "user/getUsers",
    params,
  });

/**
 * 校验账号是否存在
 * /api/user/checkLoginName
 * @param {Object} params:{}
 * */
export const checkLoginName = (params) =>
  service({
    method: "GET",
    url: "user/checkLoginName",
    params,
  });
